{extend name="Public:base2" /}

{block name="header"}
	{load href="__CSS__/contact.css" /}
{/block}

{block name="main"}
	{include file="Public:catnav2" /}

	<div class="job-body page-body contact-body">
		<div class="container">
			<div class="title">
				<h2>{$wap_catname}</h2>
				<h3>{$catname} <span></span></h3>
			</div>
			<div class="content">
				<div class="map">
					{php}
		            $baidumap = M("Digitalmap")->find(1);
		            $bdmap = json_decode($baidumap['config'], true);
		            {/php}
		            <div id="dituContent"></div>
		            <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=POcNPQVBF1nME1bSo0GIFZ0c"></script>
		            <script type="text/javascript"
		                    src="http://api.map.baidu.com/library/SearchInfoWindow/1.5/src/SearchInfoWindow_min.js"></script>
		            <link rel="stylesheet" href="http://api.map.baidu.com/library/SearchInfoWindow/1.5/src/SearchInfoWindow_min.css"/>
		            <script type="text/javascript">
		                // 百度地图API功能
		                var map = new BMap.Map('dituContent');
		                var poi = new BMap.Point({$bdmap['bdmap_x']}, {$bdmap['bdmap_y']});
		                map.centerAndZoom(poi, 18);
		                map.enableScrollWheelZoom();

		                var content = '<div>' +
		                    "地址：{$bdmap['address']}<br/>电话：{$bdmap['tel']}<br/>" +
		                    '</div>';

		                //创建检索信息窗口对象
		                var searchInfoWindow = null;
		                searchInfoWindow = new BMapLib.SearchInfoWindow(map, content, {
		                    title: "{$bdmap['name']}",      //标题
		                    width: 250,             //宽度
		                    height: 60,              //高度
		                    //panel  : "panel",         //检索结果面板
		                    enableAutoPan: false,     //自动平移
		                    searchTypes: []
		                });
		                var marker = new BMap.Marker(poi); //创建marker对象
		                searchInfoWindow.open(marker);
		                marker.addEventListener("click", function (e) {
		                    searchInfoWindow.open(marker);
		                });
		                map.addOverlay(marker); //在地图中添加marker
		            </script>
				</div>
				<div class="text">
					<h3>{$baidumap.name}</h3>	
					{$block[7]}
				</div>
			</div>
		</div>
	</div>
{/block}